package org.colin.config;

public class ConfigCode {

    public  final  static  String EntryTaleName = "d_entry_";
    public  final  static  String EntryImageTaleName = "d_entry_image_";
    public  final  static  String EntryPhraseTaleName = "d_entry_phrase_";
    public  final  static  String EntryVideoTaleName = "d_entry_video_";
    public  final  static  String PINYININDEX = "pinyinIndex_";         //拼音详情  A,B,C,D..。Z  下，各有多少拼音
    public  final  static  String STROKEINDEX = "strokesIndex_";        // 笔画详情  语种和等级下，有多少种笔画
    public  final  static  String PINYINDETAILINDEX = "pinyinDetailIndex_";    //拼音下详细内容，包含词头和ID
    public  final  static  String STROKEDETAILINDEX = "strokesDetailIndex_";  // 笔画下详细内容 包含词头和id
    public  final  static  String HOTINDEX = "hotIndex_";  //热点缓存，设置过期时间
    public  final  static  Long   OVERDUETIME = 60 * 60 * 10L;   //热点数据缓存过期时间  10小时
    public  final  static  Long   NULLENTRYOVERDUETIME = 60 * 5L;   //热点数据缓存过期时间  10小时



    public  final  static  String[] arr = new String[]{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","x","w","x","y","z"};


    public static String  getEntryTableName(Integer language){
        if(language <= 0){
            return null;
        }
        return  EntryTaleName+language;
    }


    public static String  getEntryPinYinIndex(Integer language , Integer level , String sp){
       if(language == null || language <= 0 || level == null || level <= 0 || sp == null || sp.equals("")){
           return null;
       }
        return  PINYININDEX+ language+"_"+level + "_" +sp;
    }

    public static String  getEntryStrokesIndex(Integer language , Integer level){
        if(language == null || language <= 0 || level == null || level <= 0){
            return null;
        }
        return  STROKEINDEX+ language+"_"+level;
    }

    public static String  getEntryPinYinDetailIndex(Integer language , Integer level , String py){
        if(language == null || language <= 0 || level == null || level <= 0){
            return null;
        }
        return  PINYINDETAILINDEX+ language+"_"+level+"_"+py;
    }

    public static String  getEntryStrokesDetailIndex(Integer language , Integer level , Integer strokes){
        if(language == null || language <= 0 || level == null || level <= 0){
            return null;
        }
        return  STROKEDETAILINDEX+ language+"_"+level+"_"+strokes;
    }


    public static String  getEntryDetailByHot(Integer language , Integer level,String param){
        if(language == null || language <= 0 || level == null || level <= 0){
            return null;
        }
        return  HOTINDEX+ language+"_"+level+"_"+ param;
    }

}
